package com.vessel.decoration.mvp.ui.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.vessel.decoration.R;
import com.vessel.decoration.app.base.MySupportAdapter;
import com.vessel.decoration.app.utils.UiHelper;

public class SearchPopAdapter extends MySupportAdapter<String> {

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder;
        if (convertView == null) {
            viewHolder = new ViewHolder();
            convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_search_pop, null);
            viewHolder.mListItem = UiHelper.find(convertView, R.id.list_item);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        viewHolder.mListItem.setText(getItem(position));
        return convertView;
    }

    class ViewHolder {
        TextView mListItem;
    }
}
